package com.qf.utils;

import java.util.HashMap;

/**
 * @author wanghaotian
 * time:2022/12/12,0012 19:45
 * description:
 */

public class Result extends HashMap {
    private int code;
    private String msg;
    public Result(){}
    public Result(int code){
        super.put("code", code);
    }
    public Result(int code,String msg){
        super.put("code", code);
    }
    public static Result ok(){
        return new Result(0);
    }
    public static Result ok(String msg){
        return new Result(0,msg);
    }
    public static Result error(){
        return new Result(1);
    }
    public static Result error(String msg){
        return new Result(1,msg);
    }
    public Result put(String key,Object value){
        super.put(key, value);
        return this;
    }
}
